package cn.jinjimi.domain.data.net;

import cn.jinjimi.domain.data.dto.TaskRecordDTO;
import cn.jinjimi.app.entity.TaskListBean;
import cn.jinjimi.app.entity.WebRedirectEvent;

import java.util.Map;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.Url;

/**
 * Created by zhenhua on 16/7/20.
 */
public interface TaskService {

    @POST("/app/task/action/record")
    Call<ResponseBody> record(@Body TaskRecordDTO record);

    @GET("/app/task")
    Call<TaskListBean> getTasks();

    @POST
    @FormUrlEncoded
    Call<WebRedirectEvent> notify(@Url String url, @FieldMap Map<String, String> params);

    @POST
    Call<Object> notify(@Url String url, @Query("id") String id);

}
